package com.training.java.core.collections.post15;

/**
 * This class is designed to describe the Car object The state variables cannot
 * me modified
 * 
 * @author soumya
 * 
 */
public class Car implements Comparable<Car> {

	private String make;
	private String model;
	private String vinNumber;
	private boolean started;

	public Car(String make, String model, String vinNumber, boolean started) {

		this.make = make;
		this.model = model;
		this.vinNumber = vinNumber;
		this.started = started;

	}

	/**
	 * @return the started
	 */
	public boolean isStarted() {
		return started;
	}

	public String getMake() {
		return make;
	}

	public String getModel() {
		return model;
	}

	public String getVinNumber() {
		return vinNumber;
	}

	@Override
	public boolean equals(Object obj) {

		Car that = (Car) obj;
		if (this.make.equals(that.make) && this.model.equals(that.model)) {

			return true;
		} else {
			return false;
		}

	}

	@Override
	public int hashCode() {

		return make.hashCode() + model.hashCode();
	}

	@Override
	public int compareTo(Car that) {

		return this.model.compareTo(that.model);
	}

}
